package com.hz.house.enums;
/**
 * <p>单价查询条件枚举
 * @author lfw
 */
public enum SearchPerPriceConditionEnum {

	LESS_10000Y("10000元/㎡以内",1,0,10000),
	LESS_15000Y("10000-15000 元/㎡",2,10000,15000),
	LESS_20000Y("15000-20000 元/㎡",3,15000,20000),
	LESS_25000Y("20000-25000 元/㎡",4,20000,25000),
	LESS_30000Y("25000-30000 元/㎡",5,25000,30000),
	MORE_30000Y("30000 元/㎡以上",6,30000,1000000);

	private String  name;
	
	private int id;//该标签的id
	
	private int min;//总价最小
	
	private int max;//总价最大
	
	
	SearchPerPriceConditionEnum(String name,int id,int min,int max) {
		this.name=name;
		this.id=id;
		this.min=min;
		this.max=max;
	}

	public static void main(String[] args) {
		SearchPerPriceConditionEnum[] all = SearchPerPriceConditionEnum.values();
		for(SearchPerPriceConditionEnum s:all) {
			System.out.println(s.getId());
		}
	}
	
	/**
	 * <p> 根据id获取单价枚举条件
	 * @param id
	 * @return
	 */
	public static SearchPerPriceConditionEnum getSearchPerPriceConditionById(int id) {
		SearchPerPriceConditionEnum[] all = SearchPerPriceConditionEnum.values();
		for(SearchPerPriceConditionEnum s:all) {
			if(s.getId()==id)
				return s;
		}
		return null;
	}
	
	public String getName() {
		return name;
	}


	public int getId() {
		return id;
	}


	public int getMin() {
		return min;
	}


	public int getMax() {
		return max;
	}
	
	
}
